from selenium.webdriver.common.by import By

from util.baseView import BaseView


class Advanced(BaseView):
    def __init__(self,driver):
        BaseView.__init__(self,driver)
        self.irisPreviewRadio = (By.ID, 'com.sykean.biometrics:id/radio_show_iris_preview')
        self.facePreviewRadio = (By.ID, 'com.sykean.biometrics:id/radio_show_face_preview')
        self.dismissPreviewRadio = (By.ID, 'com.sykean.biometrics:id/radio_dismiss_face_preview')

        self.onWhiteLedRadio = (By.ID , 'com.sykean.biometrics:id/radio_white_led_on')
        self.offWhiteLedRadio = (By.ID, 'com.sykean.biometrics:id/radio_white_led_off')
        self.autoWhiteLedRadio = (By.ID, 'com.sykean.biometrics:id/radio_white_led_auto')


    def irisPreview(self):
        # 关闭预览，打开虹膜
        self.click_element(*self.dismissPreviewRadio)
        self.click_element(*self.irisPreviewRadio)


    def facePreview(self):
        # 关闭预览，打开人脸预览
        self.click_element(*self.dismissPreviewRadio)
        self.click_element(*self.facePreviewRadio)


    def dismissPreview(self):
        self.click_element(*self.dismissPreviewRadio)


    def onWhiteLed(self):
        self.click_element(*self.onWhiteLedRadio)


    def offWhiteLed(self):
        self.click_element(*self.offWhiteLedRadio)

    def autoWhiteLed(self):
        self.click_element(*self.autoWhiteLedRadio)
